﻿using PetaPoco;
using System.ComponentModel.DataAnnotations;

namespace Qy.Models
{
    [TableName("qy_config")]
    [PrimaryKey("Name", AutoIncrement = true)]
    public class Config
    {
        public string Name { get; set; }
        public string Data { get; set; }

    }


    public class SytemConfig
    {
        /// <summary>
        /// 系统信息
        /// </summary>
        [Display(Name = "系统名称")]
        [Required(ErrorMessage = "系统名称不能为空")]
        public string SiteName { get; set; }
        [Display(Name = "使用单位")]
        [Required(ErrorMessage = "使用单位不能为空")]
        public string UnitOfUse { get; set; }
        [Display(Name = "系统地址")]
        [Required(ErrorMessage = "系统地址不能为空")]
        public string SiteUrl { get; set; }
        [Display(Name = "系统描述")]
        [Required(ErrorMessage = "系统描述不能为空")]
        public string Description { get; set; }

        [Display(Name = "系统版权")]
        [Required(ErrorMessage = "网站系统不能为空")]
        public string Copyright { get; set; }
        [Display(Name = "备案号")]
        public string Beian { get; set; }
        /// <summary>
        /// 上传
        /// </summary>
        [Display(Name = "上传目录 ")]
        public string BaseDir { get; set; }

        [Display(Name = "图片目录 ")]
        public string ImageDir { get; set; }

        [Display(Name = "图片大小")]
        [RegularExpression(RegxPatterns.Number, ErrorMessage = "{0}必须为数字")]
        public int ImageSize { get; set; }

        [Display(Name = "图片类型")]
        public string ImageExt { get; set; }

        [Display(Name = "附件目录 ")]
        public string FileDir { get; set; }
        [Display(Name = "消息附件")]
        public string NoticeAttDir { get; set; }

        [Display(Name = "文件类型")]
        public string FileExt { get; set; }

        [Display(Name = "文件大小")]
        [RegularExpression(RegxPatterns.Number, ErrorMessage = "{0}必须为数字")]
        public int FileSize { get; set; }

        /// <summary>
        /// 常用配置
        /// </summary>
        [Display(Name = "标记标识")]
        public string Marks { get; set; }

    }


    public class SystemInfo
    {
        public string SiteName { get; set; }
        public string UnitOfUse { get; set; }
        public string SiteUrl { get; set; }
        public string Description { get; set; }
        public string Copyright { get; set; }
        public string Beian { get; set; }
    };
    public class UpLoadConfig
    {
        public string BaseDir { get; set; }
        public string ImageDir { get; set; }
        public int ImageSize { get; set; }
        public string ImageExt { get; set; }
        public string FileDir { get; set; }
        public string FileExt { get; set; }

        public int FileSize { get; set; }
    };
    public class CommonlyUsed
    {
        public string Marks { get; set; }
    };


}